<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      width: 1500px;
      height: 700px;
      position: relative;
      border: 1px solid #333  ;
    }

    img {
      animation: move 3s linear;
    }

    @keyframes move {
      to {
        bottom: 0%;
      }
    }
  </style>
</head>
<body>
  <div class="box"></div>
</body>
<script>
  // 
  const box = document.querySelector('.box')
  // 生成随机数
  function getImg() {
    let randoms = Math.floor(Math.random() * (14 - 10 + 1) + 10)
    return randoms;
  }

  // 随机生成位置
  const timer = setInterval(function(){
    let x = Math.floor(Math.random()*100)
    let y = Math.floor(Math.random()*100)
    // 创建一个img
    const img = document.createElement('img');
    img.src = '../images/' + getImg() + '.png';
    img.style = 'left:' + x + '%;bottom:' + y + '%;position: absolute;';
    box.appendChild(img);

    setTimeout(function(){
      box.removeChild(img)
    },3000)
  },1000)

</script>
</html>